<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <title>输出业务编辑页面</title>
    <%@ include file="../../common/meta.jsp" %>
    <%@ include file="../../common/common-body.jsp" %>
    <link href="${ctx}/css/plugins/note/note.css?t=${now}" rel="stylesheet">
    <link href="${ctx}/css/page/common-win.css?t=${now}" rel="stylesheet">
    <script src="${ctx}/js/plugins/note/note.js?t=${now}"></script>
    <script src="${ctx}/js/plugins/validate/jquery.validate.custom.js?t=20181024"></script>
</head>
<style>
    #_btnDiv{
        height: 34px;
        margin-bottom: 0px;
    }
    .none-border{
        border: none!important;
        padding-top: 0px;
    }
    .my-modal-body{
        padding: 0px 20px 10px 20px;!important;
    }
</style>
<script>
    var editType = '${editType}';
    var searchStr = '${searchStr}';
    var oneOutputInfo = ${oneOutputInfo};
    var searchInfo = ${searchInfo};
    var cBizMap = ${cBizMap};
    var bizMap = ${bizMap};
    var cityMap = ${cityMap};
</script>
<body class="gray-bg">
<div id="vue">
    <div class="myContent">
        <div class="tabs-container">
            <div class="tab-content">
                <div id="tab-1" class="tab-pane active">
                    <div class="row">
                        <div class="col-sm-12">
                            <div class="ibox float-e-margins myIbox">
                                <div class="ibox-content" id="_bizDiv">
                                    <form class="form-horizontal m-t" id="_outputDataForm">
                                        <div class="form-group form-group-new">
                                            <label class="col-sm-2 control-label"><span style="color: red">*</span>输出平台：</label>
                                            <div class="col-sm-8">
                                                <select class="form-control" name="destType" id="destType" required>
                                                    <option value="">--请选择--</option>
                                                    <c:forEach items="${destTypeMap}" var="item">
                                                        <option value="${item.code}" ${not empty oneOutputInfo && oneOutputInfo.destType == item.code? 'selected' : '' }>${item.name}</option>
                                                    </c:forEach>
                                                </select>
                                                <span class="help-block m-b-none tip"></span>
                                            </div>
                                        </div>
                                        <div class="form-group form-group-new">
                                            <label class="col-sm-2 control-label"><span style="color: red">*</span>业务：</label>
                                            <div class="col-sm-8">
                                                <select class="form-control" name="pBizCode" id="pBizCode" required onchange="doChangeParentBiz()">
                                                    <option value="">--请选择--</option>
                                                    <c:forEach items="${bizMap}" var="item">
                                                        <option value="${item.code}" ${not empty oneOutputInfo && oneOutputInfo.pBizCode == item.code? 'selected' : '' }>${item.name}</option>
                                                    </c:forEach>
                                                </select>
                                                <span class="help-block m-b-none tip"></span>
                                            </div>
                                        </div>
                                        <div class="form-group form-group-new">
                                            <label class="col-sm-2 control-label"><span style="color: red">*</span>业务服务项：</label>
                                            <div class="col-sm-8">
                                                <select class="form-control" name="bizCode" id="bizCode" required>
                                                    <option value="">--请选择--</option>
                                                    <c:forEach items="${cBizMap}" var="item">
                                                        <option value="${item.code}" ${not empty oneOutputInfo && oneOutputInfo.bizCode == item.code? 'selected' : '' }>${item.name}</option>
                                                    </c:forEach>
                                                </select>
                                                <span class="help-block m-b-none tip"></span>
                                            </div>
                                        </div>
                                        <div class="form-group form-group-new">
                                            <div class="col-sm-2 control-label">
                                                <span style="color: red">*</span>服务商：
                                                <br>
                                                <input type="button" class="btn btn-info" onclick="openAddIsvPage()" value="选择服务商">
                                                <input type="button" class="btn btn-info" onclick="clearIsv()" value="删除全部">
                                            </div>
                                            <div class="col-sm-8">
                                                <div class="note" name="_isvTags" readonly="true">
                                                    <c:if test="${not empty oneOutputInfo}">
                                                        <c:forEach items="${oneOutputInfo.isvList}" varStatus="i" var="item" >
                                                            <div class="note_lable" name="_isvTags" value="${item.isvPid}">
                                                                <lable>${item.isvName}</lable>
                                                                <div  onclick="$(this).parent().remove()">X</div>
                                                                <div  class="note_mind"></div>
                                                            </div>
                                                        </c:forEach>
                                                    </c:if>
                                                </div>
                                                <span class="help-block m-b-none tip"></span>
                                            </div>
                                        </div>
                                        <div class="form-group form-group-new">
                                            <div class="col-sm-2 control-label">
                                                <span style="color: red">*</span>城市：
                                                <br>
                                                <input type="button" class="btn btn-info" onclick="openAddCityPage()" value="选择城市">
                                                <input type="button" class="btn btn-info" onclick="clearCity()" value="删除全部">
                                            </div>
                                            <div class="col-sm-8">
                                                <div class="note" name="_cityTags" readonly="true">
                                                    <c:if test="${not empty oneOutputInfo}">
                                                        <c:forEach items="${oneOutputInfo.cityList}" varStatus="i" var="item" >
                                                            <div class="note_lable" name="_cityTags" value="${item.dictCode}">
                                                                <lable>${item.dictName}</lable>
                                                                <div  onclick="$(this).parent().remove()">X</div>
                                                                <div  class="note_mind"></div>
                                                            </div>
                                                        </c:forEach>
                                                    </c:if>
                                                </div>
                                                <span class="help-block m-b-none tip"></span>
                                            </div>
                                        </div>
                                        <div class="form-group form-group-new">
                                            <div class="col-sm-2 control-label">
                                                <span style="color: red">*</span>关联一级科室：
                                                <br>
                                                <input type="button" class="btn btn-info" onclick="openAddDeptPage()" value="添加科室">
                                                <input type="button" class="btn btn-info" onclick="clearDept()" value="删除全部">
                                            </div>
                                            <div class="col-sm-8">
                                                <div class="note" name="_deptTags" readonly="true">
                                                    <c:if test="${not empty oneOutputInfo}">
                                                        <c:forEach items="${oneOutputInfo.deptList}" varStatus="i" var="item" >
                                                            <div class="note_lable" name="_deptTags" value="${item.deptCode}">
                                                                <lable>${item.deptName}</lable>
                                                                <div  onclick="$(this).parent().remove()">X</div>
                                                                <div  class="note_mind"></div>
                                                            </div>
                                                        </c:forEach>
                                                    </c:if>
                                                </div>
                                                <span class="help-block m-b-none tip"></span>
                                            </div>
                                        </div>
                                        <div class="form-group form-group-new">
                                            <label class="col-sm-2 control-label">排序：</label>
                                            <div class="col-sm-8">
                                                <input type="text" id="sortNum" name="sortNum" class="form-control" maxlength="9" isPInteger="true" value="${not empty oneOutputInfo ? oneOutputInfo.sortNum : ''}">
                                                <span class="help-block m-b-none tip"></span>
                                            </div>
                                        </div>
                                        <div class="form-group form-group-new">
                                            <label class="col-sm-2 control-label">备注：</label>
                                            <div class="col-sm-8">
                                                <textarea type="text" id="remark" name="remark" class="form-control" maxlength="500" style="height: 80px; resize: none;" placeholder="500字以内">${not empty oneOutputInfo ? oneOutputInfo.remark : ''}</textarea>
                                                <span class="help-block m-b-none tip"></span>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="ibox float-e-margins">
            <div class="ibox-content">
                <div class="form-group" id="_btnDiv">
                    <div class="col-sm-4 col-sm-offset-5">
                        <c:if test="${type != 'info'}">
                            <input type="button" class="btn btn-info" onclick="doSave()" value="保存">
                        </c:if>
                        <input type="button" class="btn btn-white" onclick="doCheckDataChange()" value="返回">
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div id="addIsvPage" class="modal" tabindex="-1" role="dialog" data-backdrop="static" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content animated bounceInRight">
            <div class="modal-header text-center">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4>选择服务商</h4>
            </div>
            <div class="modal-body modal-body-height">
                <div class="row">
                    <div class="form-group">
                        <label class="col-sm-2 control-label" style="padding-top: 5px;">服务商：</label>
                        <div class="col-sm-8">
                            <div class="input-group">
                                <input type="hidden" id="isvPid" name="isvPid">
                                <input type="text" id="isvName" name="isvName" class="form-control" placeholder="请输入服务商">
                                <div class="input-group-btn">
                                    <button type="button" class="btn btn-default dropdown-toggle mySearchBtn" data-toggle="dropdown">
                                        <span class="caret"></span>
                                    </button>
                                    <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer" style="text-align: center;">
                <button class="btn btn-info" onclick="doAddIsv()">保存</button>
                <button class="btn btn-white" onclick="$('#addIsvPage').modal('hide')">取消</button>
            </div>
        </div>
    </div>
</div>

<div id="addDeptPage" class="modal" tabindex="-1" role="dialog" data-backdrop="static" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content animated bounceInRight">
            <div class="modal-header text-center">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4>选择关联一级科室</h4>
            </div>
            <div class="modal-body modal-body-height">
                <div class="row">
                    <div class="form-group">
                        <label class="col-sm-2 control-label" style="padding-top: 5px;">科室：</label>
                        <div class="col-sm-8">
                            <div class="input-group">
                                <input type="hidden" id="deptCode" name="deptCode">
                                <input type="text" id="deptName" name="deptName" class="form-control" placeholder="请输入科室名">
                                <div class="input-group-btn">
                                    <button type="button" class="btn btn-default dropdown-toggle mySearchBtn" data-toggle="dropdown">
                                        <span class="caret"></span>
                                    </button>
                                    <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal-footer" style="text-align: center;">
                <button class="btn btn-info" onclick="doAddDept()">保存</button>
                <button class="btn btn-white" onclick="$('#addDeptPage').modal('hide')">取消</button>
            </div>
        </div>
    </div>
</div>

<div id="addCityPage" class="modal" tabindex="-1" role="dialog" data-backdrop="static" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content animated bounceInRight">
            <div class="modal-header text-center">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4>选择城市</h4>
            </div>
            <div class="modal-body modal-body-height my-modal-body">
                <div class="row">
                    <div class="col-sm-12">
                        <div class="ibox float-e-margins" style="margin-bottom: 0px;">
                            <div class="ibox-content ibox-content-search none-border" style="padding-bottom: 0px;">
                                <form class="form-horizontal m-t" novalidate="novalidate">
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label control-model">城市名称：</label>
                                        <div class="col-sm-10">
                                            <div class="input-group" style="width: 460px!important;">
                                                <input type="text" name="searchKey" id="_searchKey" class="form-control" onkeydown="if(event.keyCode==13){queryCity();return false;}"
                                                       maxlength="30">
                                                <span class="input-group-btn"> <button type="button" class="btn btn-primary" onclick="queryCity()">查询</button></span>
                                            </div>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <table class="table table-bordered">
                        <thead>
                        <tr>
                            <th style="width: 30px;">#</th>
                            <th>
                                <label idd="全国" style="width: 140px;float: left;">
                                    <input type="checkbox" name="cityAll" value="all"/>全国
                                </label>
                                <label idd="inverse" style="width: 140px;float: left;">
                                    <input type="checkbox" name="cityInverse" value="inverse"/>反选
                                </label>
                            </th>
                        </tr>
                        </thead>
                        <tbody id="cityData">
                        <c:forEach items="${cityMap}" var="item">
                            <tr>
                                <td>${item.cap}</td>
                                <td id="myCities">
                                    <c:forEach items="${item.cities}" var="city">
                                        <label idd="${city.dictName}" style="width: 140px;float: left;">
                                            <input type="checkbox" name="cityCb" value="${city.dictCode}"/>${city.dictName}&nbsp;&nbsp;
                                        </label>
                                    </c:forEach>
                                </td>
                            </tr>
                        </c:forEach>
                        </tbody>
                    </table>
                </div>
            </div>
            <div class="modal-footer" style="text-align: center;">
                <button class="btn btn-info" onclick="doAddCity()">保存</button>
                <button class="btn btn-white" onclick="$('#addCityPage').modal('hide')">取消</button>
            </div>
        </div>
    </div>
</div>

<script src="${ctx}/js/output/win/editOutputMgr.js?time=${now}"></script>
</body>
</html>
